package components.propertyCtrls
{
	import UIFree.controls.uif_scrollbar;
	import UIFree.uif_component;
	
	import UIUtils.uif_matrix;
	import UIUtils.uif_util;
	
	import classes.c_util;
	
	import flash.events.Event;
	import flash.geom.Rectangle;
	
	public class c_numberCtrl extends c_propertyBase {
		public static const WEIGHT: Number = 50;
		
		private var _scrollBar: uif_scrollbar;
		public function c_numberCtrl(parent:uif_component, aData: Object, ay: Number, a_weight: Number) {
			super(parent, aData, ay, a_weight);
		}
		
		override protected function createComponents():void {
			super.createComponents();
			var rect: Rectangle = componentRect;
			_scrollBar = new uif_scrollbar(this, rect.x, rect.y, rect.width, rect.height, 'scrollbar');
			_scrollBar.addEvent(uif_scrollbar.SCROLLING, doChange);
		}
		
		override protected function setData(value:Object):void {
			super.setData(value);
			if (_data.scrollBar) uif_util.setValues(_scrollBar, _data.scrollBar);
			_scrollBar.value = _data.value;
		}
		
		override protected function getValue(): Object {
			return _scrollBar.value;
		}		
	}
}